Skip to content

feat(turn): list and start agents of every namespace the user may see - #1400

Merged
fiunchinho merged 2 commits into
mainfrom
turn-every-namespace
Dec 2, 2026
Merged

fiunchinho merged 2 commits into
mainfrom
turn-every-namespace

Conversation

@fiunchinho

Copy link
Copy Markdown
Member

Part of giantswarm/giantswarm#39704

Problem

agentlab turn could reach the kagent namespace only: its roster asked ListAgents and ListAgentTemplates for kagent, and it started every Session with an agentRef fixed to kagent. The manual test of the platform public namespace (slice 5 of giantswarm/giantswarm#39639) needs one Session turn in public-agents, and turn could not start one there (giantswarm/giantswarm#39702, comment of 2026-12-02).

Change

  • turn --list asks ListAgents and ListAgentTemplates with no namespace, as klaus-gateway and the Dev Portal do. The kagent API lists every namespace the caller may list for an empty namespace. Each line keeps <namespace>/<name>.
  • AgentTemplates are indexed by namespace and name. An Agent's templateRef is a local reference, so each Agent pairs with the template of its own namespace only.
  • --template <name> selects among the Agents of every namespace by the same rules as before. The new flag --namespace <ns> keeps the Agents of one namespace. A name with Agents in more than one namespace is refused without --namespace, and the refusal names the namespaces. The refusal comes before --harness or the readiness can pick one.
  • The Session starts through start_session with the selected Agent's own namespace. --session, --delete, --keep, --share-with and --suspend work by Session id, so they work in every namespace.
  • --namespace with --list, --session or --delete is refused.
  • The shared roster(), listAgents, listTemplates and agentRef(name) do not change, so a2a-test and the other proofs keep their behavior. The template index is shared; findListing stays correct with it.
  • Known limit, documented: agent-manager's start_session takes namespace only for its own platform namespaces (kagent, and public-agents where the chart has it). For an organization's namespace it refuses and names the organization. So turn lists an organization's agents but cannot start a Session of one.
  • Docs: the turn help text, docs/cli.md, docs/agents.md and AGENTS.md.

Tests

  • TestRosterListingsOfEveryNamespace: the roster through the fake controller lists kagent, public-agents and an organization namespace, and a template name in two namespaces gives each Agent the display name of its own namespace.
  • TestSelectAgentAcrossNamespaces: a template name in two namespaces is refused without --namespace (also with --harness), and chosen with it; an inline Agent of public-agents is chosen by its name.
  • TestStartTurnSessionInTheAgentsNamespace: start_session gets namespace: public-agents for the Agent chosen there, while an Agent of the same name is in kagent.
  • The fake controller now lists every namespace for an empty namespace, as the kagent API does.
  • Local: go build ./..., go test ./... and golangci-lint (GOOS=linux, 0 issues) ran. On this macOS host five tests fail on main and on this branch alike (shell differences): TestBrowserProtocolCommand, TestGitPauseAndResumeCommands, TestMeasureBuildDownloadsDependencies, TestMeasureBuildNotAvailable, TestSessionDirectoryProbeReadsOnlySelectedIDs.
  • No live run against a lab yet: that is the manual test of giantswarm/giantswarm#39704.

Review

Id Severity Outcome Finding
F1 non-blocking fixed AGENTS.md and docs/agents.md still said the lab passes namespace only for kagent; they now name turn as the exception.
F2 non-blocking fixed No test checked the namespace that turn sends to start_session; startTurnSession holds that step and TestStartTurnSessionInTheAgentsNamespace checks it.

The second reviewer found nothing to fix.

turn --list asks ListAgents and ListAgentTemplates with no namespace, as klaus-gateway and the Dev Portal do, and pairs each Agent with the AgentTemplate of its own namespace. --template selects among the Agents of every namespace; --namespace limits it to one, and a name with Agents in more than one namespace is refused without it. The Session is started with the agentRef of the selected Agent's own namespace.

Part of giantswarm/giantswarm#39704
… name turn's namespace

startTurnSession holds the select-then-start step of turn, so a test sees the start_session arguments. AGENTS.md and docs/agents.md name turn as the one lab path that passes another namespace than kagent.
@fiunchinho fiunchinho self-assigned this Dec 2, 2026
@fiunchinho
fiunchinho marked this pull request as ready for review December 2, 2026 13:29
@fiunchinho
fiunchinho requested a review from a team as a code owner December 2, 2026 13:29
@fiunchinho
fiunchinho merged commit 319baaf into main Dec 2, 2026
8 checks passed
@fiunchinho
fiunchinho deleted the turn-every-namespace branch December 2, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant